const app = getApp();

Page({

  onReady: function() {
    //获得dialog组件
    this.dialog = this.selectComponent("#dialog");
  },

  showDialog() {
    this.dialog.showDialog();
  },

  // 取消事件
  cancelEvent() {
    console.log('你点击了取消');
    this.dialog.hideDialog();
  },
  // 确认事件
  confirmEvent() {
    console.log('你点击了确定');
    this.dialog.hideDialog();
  }

})